/**
 * @file drv_math,c
 * @author scj (443002340@qq.com)
 * @brief 移植的数学函数实现
 * @version 0.1
 * @date 2025-10-02
 * 
 * @copyright Copyright (c) 2025
 * 
 */

#ifndef DRV_MATH_H
#define DRV_MATH_H

#include "stm32f4xx_hal.h"
#include "arm_math.h"
#include "stdbool.h"
#include <float.h>

// rpm换算到rad/s
#define RPM_TO_RADPS (2.0f * PI / 60.0f)
// deg换算到rad
#define DEG_TO_RAD (PI / 180.0f)
// 摄氏度换算到开氏度
#define CELSIUS_TO_KELVIN (273.15f)


void Math_Boolean_Logical_Not(bool *Value);


uint16_t Math_Endian_Reverse_16(void *Source, void *Destination);



uint32_t Math_Endian_Reverse_32(void *Source, void *Destination);

uint8_t Math_Sum_8(uint8_t *Address, uint32_t Length);

uint16_t Math_Sum_16(uint16_t *Address, uint32_t Length);

uint32_t Math_Sum_32(uint32_t *Address, uint32_t Length);

float Math_Sinc(float x);

int32_t Math_Float_To_Int(float x, float Float_1, float Float_2, int32_t Int_1, int32_t Int_2);

float Math_Int_To_Float(int32_t x, int32_t Int_1, int32_t Int_2, float Float_1, float Float_2);

float Math_Modulus_Normalization(float x, float modulus);
#endif // !DRV_MATH_H